arr=eval(input())
num= int(input())

for i in arr:
    lst1=[]
    lst2=[]
    arr.sort()
    if i<4:
        list1.append(i)
    else:
        list2.append(i)
res=[]
len1=len(list1)
len2=len(list2)
if num==1:
    if len1==0 and len2 ==0:
        print([])

    elif len1==0 and len2 !=0:
        for i in range(len2):
            res.append(len2[i:i+1:1])
        print(res)
    elif len1 !=0 and len2==0:
        for i in range(len1):
            res.append(len1[i:i+1:1])
        print(res)
    elif len1==1 and len2!=1:
        res.append(len[0])
        print


elif num==2:


elif num==4:


elif num==8:
